<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./MyPromise.js"></script>
  </head>
  <body>
    <script>
      //   let test = new Test((reslove, reject) => {
      //     reslove(100)
      //     reject(200)
      //   })
      // let p2 = new MyPromise((resolve, reject) => {
      // console.log("i")
      // resolve(100)
      // reject(200)
      //   })
      //new 一个类参数是一个函数  为什么构造函数里面用constructor
      let p1 = new MyPromise((resolve, reject) => {
        // console.log("i")
        resolve(100)
        // reject(200)
      })
      let p2 = new Promise((resolve, reject) => {
        resolve(200)
      })
      // let a = Promise.all(['a','b','c'])
      // console.log(a,'a');
      console.log(p1, p2, "p1")
    </script>
  </body>
</html>
